class Solution {
public:
    void moveZeroes(vector<int>& nums)
    {
        int p1 = 0;
        int p2 = 0;
        int n = nums.size();

        while (p1 < n)
        {
            if (nums[p1])
            {
                swap(nums[p1], nums[p2]);
                p2++;
                p1++;
            }
            else
            {
                p1++;
            }
        }

    }
};